﻿Type=Activity
Version=5.8
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.

	Private lbltitle As Label
	Private clvmyinfos As clsCustomListView
	Private itemname As Label
	Private itemvalue As Label
	Private ivrightarr As ImageView
End Sub

Sub Activity_Create(FirstTime As Boolean)
	'Do not forget to load the layout file created with the visual designer. For example:
	Activity.LoadLayout("laymodifymyinfo")
	initviews
End Sub
Private Sub initviews
	lbltitle.Text="设置"
	Dim nw As Int=100%x,nh As Int=60dip
	clvmyinfos.dividerHeight=1dip
	clvmyinfos.Add(CreateItemCommon("用户协议","",nw,nh,True),nh,0)
	clvmyinfos.Add(CreateItemCommon("关于我们","",nw,nh,True),nh,1)
	clvmyinfos.Add(CreateItemCommon("版本升级","v1.0.0",nw,nh,True),nh,2)
	clvmyinfos.Add(CreateItemCommon("联系客服","",nw,nh,True),nh,3)
	clvmyinfos.AddCustomDivider(15dip)
	clvmyinfos.Add(CreateLogoffItem(nw,nh),nh,4)
End Sub
Private Sub CreateLogoffItem(w As Int,h As Int) As Panel
	Dim p As Panel
	p.Initialize("")
	Activity.AddView(p,0,0,w,h)
	Dim lbl As Label
	lbl.Initialize("")
	lbl.Text="退出登录"
	lbl.TextColor=comm.N_COLOR_TITLE
	lbl.TextSize=18
	lbl.Color=Colors.White
	lbl.Gravity=Gravity.CENTER
	p.AddView(lbl,0,0,w,h)
	p.RemoveView
	Return p
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Private Sub CreateItemCommon(str As String,val As String,w As Int,h As Int,hasArr As Boolean) As Panel
	Dim p As Panel
	p.Initialize("")
	Activity.AddView(p,0,0,w,h)
	p.LoadLayout("itemmodifymyinfocommon")
	ivrightarr.Visible=hasArr
	p.RemoveView
	itemname.Text=str
	itemvalue.Text=val
	Return p
End Sub
Private Sub setItemVal(p As Panel,val As String)
	Dim lbl As Label
	For Each v As View In p.GetAllViewsRecursive
		Log(v.Tag)
		If "val".EqualsIgnoreCase(v.Tag) Then
			lbl=v
			lbl.Text=val
		End If
	Next
	Return
End Sub

Sub ivback_Click
	Activity.Finish
End Sub

Sub clvmyinfos_ItemClick (Index As Int, Value As Object)
	Select Value
		Case 0'用户协议
			Dim vw As wvUrl
			vw.Initialize
			vw.title="用户协议"
			vw.Url="www.qq.com"
			comm.startWV(vw)
		Case 1'关于我们
			comm.ShowUrl("http://www.baidu.com")
		Case 2 '版本升级
			ToastMessageShow("版本升级",False)
		Case 3'联系客服
			Dim pi As Intent
			pi.Initialize(pi.ACTION_VIEW,"tel:"&comm.S_CLIENTPHONENUMBER)
			StartActivity(pi)
		Case 4'退出登录
			ToastMessageShow("退出登录",False)
	End Select
End Sub